package cn.manyufun.myf.common.irecyclerview.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.RelativeLayout;

import cn.manyufun.myf.R;
import cn.manyufun.myf.common.commonwidget.MYFProgressBar;
import cn.manyufun.myf.common.irecyclerview.RefreshTrigger;

/**
 * Created by Xiao on 2018-02-02.
 */

public class MYFHeaderView extends RelativeLayout implements RefreshTrigger {
    private final MYFProgressBar progressBar;

    public MYFHeaderView(Context context) {
        this(context, null);
    }

    public MYFHeaderView(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public MYFHeaderView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        inflate(context, R.layout.myf_classic_refresh_header_view, this);

        progressBar = findViewById(R.id.myfprogressbar);
    }


    @Override
    public void onStart(boolean automatic, int headerHeight, int finalHeight) {
        progressBar.setIndeterminate(false);
    }

    @Override
    public void onMove(boolean finished, boolean automatic, int moved) {

    }

    @Override
    public void onRefresh() {
        progressBar.setVisibility(VISIBLE);

    }

    @Override
    public void onRelease() {

    }

    @Override
    public void onComplete() {

    }

    @Override
    public void onReset() {

    }
}
